<template>
  <div class="container">
    <!-- 11.2 arr替换tableDate -->
    <!-- <el-table :data="tableData" style="width: 100%"> -->
      <h1>今日门诊记录</h1>
    <el-table :data="arr" style="width: 100%">
      <el-table-column type="index" :index="indexMethod" label="序号" align="center"></el-table-column>
      <el-table-column label="就诊状态" align="center">
        <template slot-scope="scope">
          <span style="color: #b1eed8">{{ attendanceStatustype[scope.row.attendanceStatus] }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="patientsWithNumber" label="患者编号" align="center"></el-table-column>
      <el-table-column prop="name" label="患者姓名" align="center"></el-table-column>
      <el-table-column label="性别" align="center">
        <template slot-scope="scope">{{ sextype[scope.row.sex] }}</template>
      </el-table-column>
      <el-table-column prop="age" label="年龄" align="center"></el-table-column>
      <el-table-column prop="phone" label="手机号码" align="center"></el-table-column>
      <el-table-column label="门诊类型" align="center">
        <template slot-scope="scope">{{ outpatientServiceType1[scope.row.outpatientServiceType] }}</template>
      </el-table-column>
      <el-table-column label="科室" align="center">
        <template slot-scope="scope">{{ department[scope.row.department] }}</template>
      </el-table-column>
      <el-table-column prop="doctor" label="挂号医生" align="center"></el-table-column>
      <el-table-column prop="date" label="最后更新时间" align="center"></el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  //  11.1
  props: ["arr"],
  data() {
    return {
      attendanceStatustype: {
        0: "待接诊",
        1: "接诊中",
        2: "已完成"
      },
      sextype: {
        0: "男",
        1: "女"
      },
      outpatientServiceType1: {
        0: "出诊",
        1: "已完成"
      },
      department: {
        0: "全科",
        1: "急诊"
      }
      // tableData: [
      //   {
      //     id: 1,
      //     attendanceStatus: 2, //0待接诊1接诊中2已完成
      //     patientsWithNumber: "23131",
      //     name: "王小虎",
      //     sex: "0", //0男1女
      //     age: 21,
      //     phone: 13121212121,
      //     outpatientServiceType: "1", //0出诊1已完成
      //     department: "1", //0全科1全科
      //     doctor: "王小",
      //     date: "2016-05-04"
      //   }
      // ]
    };
  },
  methods: {
    indexMethod(index) {
      return index + 1;
    }
  }
};
</script>

<style lang='less' scoped>
.container {
  padding-right: 55px;
  .el-table {
    border-radius: 9px;
    margin-left: 28px;
    font-size: 14px;
    color:#afafaf;
    border: 1px;
  }
}
h1 {
    margin-top: 20px;
    margin-bottom: 23px;
    margin-left: 28px;
    height: 18px;
    font-size: 18px;
    color: rgba(0, 0, 0, 0.84);
  }

  /deep/.el-table td.el-table__cell{
 
  }
</style>